using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using System.Xml.Serialization;
using Microsoft.Xna.Framework;
using CreamX.Framework.Game;

namespace CreamX.Core.TileGrid
{
    public class TileGridManager
    {
        public void Initialize()
        {
            foreach (SpriteSheet __s in SpriteSheets.Values)
            {
                __s.Texture.Init();
                __s.Texture.Texture = CreamXGame.Instance.Content.Load<Texture2D>(
                    GetFileNameWithoutExtension(__s.Texture.MaterialFilename));
                
            }


        }

        private string GetFileNameWithoutExtension(string p)
        {
            return p.Substring(0, p.LastIndexOf("."));
        }
        [XmlIgnore()]
        public List<TileGrid> TileGrids = new List<TileGrid>();
        [XmlIgnore()]
        public Dictionary<string, SpriteSheet> SpriteSheets = new Dictionary<string, SpriteSheet>();
    }
}
